#include "Image.h"

std::map<std::string,jfw::Image*> jfw::Image::ImageList;

jfw::Image::Image(void)
{
}

jfw::Image* jfw::Image::Get(std::string m_sFilename)
{
    if( ImageList.find(m_sFilename) == ImageList.end() )
    {
        jfw::Image* tmp = new jfw::Image();
        ImageList.insert( std::pair<std::string,jfw::Image*>( m_sFilename, tmp ) );
        if( ImageList[m_sFilename]->LoadFromFile(m_sFilename) )
            std::cout << "zaladowano" << std::endl;
    }

    return ImageList.find(m_sFilename)->second;
}

jfw::Image::~Image()
{
    //ImageList.clear();
}
